# encoding:utf-8
import urllib
import urllib2


def send_short_msg(tpl_id='2', tpl_value="#code#=123456", mobile_number='18672196610'):
    url = 'http://yunpian.com/v1/sms/tpl_send.json'
    values = {
        'apikey': '0cae3c9d6ecade53a787efabb4a16729',
        # 'apikey': '1c6a00f8b572e652505b893748212651',
        'mobile': mobile_number,
        'tpl_id': tpl_id,
        'tpl_value': tpl_value,
    }
    print values
    data = urllib.urlencode(values)
    req = urllib2.Request(url, data)
    response = urllib2.urlopen(req)
    return response.read()
